package com.brspace.qualitycontrol.utils;

import lombok.Data;

/**
 * @author wangt
 * @since 2021/2/4
 */
@Data
public class MilkException extends RuntimeException{
    //状态码
    private Integer code;

    /**
     * 接受状态码和消息
     * @param code
     * @param message
     */
    public MilkException(Integer code, String message) {
        super(message);
        this.code=code;
    }

    /**
     * 接收枚举类型
     * @param resultCodeEnum
     */
    public MilkException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }


}
